;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

;;; module for utility packages/tools specifically for wayland and wlroots
;;; graphical environments

(define-module (guixrus packages gemini-xyz)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix build utils)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (gnu packages tls)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system meson)
  #:use-module (guix build-system cmake)
  #:use-module (gnu packages pkg-config))

(define-public gemurl
  (let ((commit "376f87087aa3bd91391ad8f73c61e01b942779f1")
        (revision "0"))
    (package
      (name "gemurl")
      (version (git-version "20220316" revision commit))
      (source
        (origin
         (method git-fetch)
         (uri
          (git-reference
            (url "https://git.josias.dev/gemini/gemurl")
            (commit commit)))
         (sha256
          (base32 "1ipyjgalwlvxf4xplj8c2c36lvw6h2chp3a0iyzb87aa1s2v5g26"))))
      (build-system gnu-build-system)
      (native-inputs (list pkg-config))
      (inputs (list openssl))
      (arguments
       `(#:tests? #f ; There are no tests.
         #:make-flags
         (list
          (string-append "PREFIX="
                         (assoc-ref %outputs "out"))
          (string-append "CC=" ,(cc-for-target))
          (string-append "PKG_CONFIG=" ,(pkg-config-for-target)))
         #:phases
         (modify-phases %standard-phases
         (delete 'configure))))
      (synopsis "cURL-like utility for Gemini")
      (description
"@code{gemurl} is an all-purpose tool for interacting with Gemini servers
via the command line.")
      (home-page "https://git.josias.dev/gemini/gemurl/")
      (license license:bsd-3))))

